package Thread_;

import java.util.Scanner;

/**
 * @Author 汤舒青
 * @Version 1.0
 */


public class Thread03 extends Thread {

    public static void main(String[] args) throws InterruptedException {
        Scanner input = new Scanner(System.in);
        Thread03 t = new Thread03();
        t.start();
        System.out.println("请输入用户名：");
        String name = input.next();
        System.out.println("请输入密码：");
        String pwd = input.next();
        while (true) {
            if (name.equals("admin") && pwd.equals("pwd")) {
                System.out.println("welcome to。。。。");
                return;
            } else {
                System.out.println("用户名或密码错误");
                return;
            }
        }
    }

    @Override
    public void run() {
        try {
            sleep(40000);
            System.out.println("超时退出");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.exit(1);
    }
}
